<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='zhyyglhtxt'/></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }
    </style>
</head>

<body>
<div class="layui-container">
    <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
        <form:form commandName="supplier" method="${_method }" class="layui-form" id="serviceForm">
            <input type="hidden" name="_method" value="${_method }"/>

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='zhxx'/></legend>
            </fieldset>

            <div class="layui-row layui-col-space30">
                <div class="layui-col-md6">

                    <c:if test="${_method eq 'POST'}">
                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='gyszh'/></label>
                            <div class="layui-input-inline">
                                <form:input path="username" lay-verify="required" class="layui-input"/>
                            </div>
                        </div>
                    </c:if>


                </div>
                <div class="layui-col-md6">

                    <c:if test="${_method eq 'POST'}">
                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='dlmm'/></label>
                            <div class="layui-input-inline">
                                <form:input path="password" lay-verify="required" value="123456" class="layui-input"/>
                            </div>
                        </div>
                    </c:if>

                </div>
            </div>





            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='dpmc'/></legend>
            </fieldset>


            <div class="layui-form-item">
                <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='jylm'/></label>
                <div class="layui-input-block">
                    <c:if test="${_method eq 'POST'}">
                        <c:forEach items="${channels}" var="item">
                            <input type="checkbox" name="channels" value="${item.id}" title="${item.name}"/>
                        </c:forEach>
                    </c:if>
                    <c:if test="${_method eq 'PUT'}">
                        <c:forEach items="${channels}" var="item">
                            <input type='checkbox' name='channels'
                                   <c:if test="${fn:contains(channelNames, item.name)}">checked="checked"</c:if> value='${item.id}' title='${item.name}'/>
                        </c:forEach>
                    </c:if>
                    <input type="hidden" name="merchantGoodsChannelsData" id="merchantGoodsChannelsData"/>
                </div>

            </div>

            <div class="layui-row layui-col-space30">
                <div class="layui-col-md6">

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='dpmc'/></label>
                        <div class="layui-input-inline">
                            <form:input path="shopName" lay-verify="required" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='lxrxm'/></label>
                        <div class="layui-input-inline">
                            <form:input path="realName" lay-verify="required" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='yx'/></label>
                        <div class="layui-input-inline">
                            <form:input path="email" lay-verify="required" class="layui-input"/>
                        </div>
                    </div>


                </div>
                <div class="layui-col-md6">

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='lxdh'/></label>
                        <div class="layui-input-inline">
                            <form:input path="mobile" lay-verify="required" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='wx'/></label>
                        <div class="layui-input-inline">
                            <form:input path="wechat" lay-verify="required" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> QQ</label>
                        <div class="layui-input-inline">
                            <form:input path="qq" lay-verify="required" class="layui-input"/>
                        </div>
                    </div>

                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='gysztlx'/></label>
                <div class="layui-input-inline" style="width:70%;">
                    <input type="radio" name="mainType" lay-filter="mainType" lay-verify="required" value="1" title="<fmt:message key='qy1'/>" <c:if test="${supplier.mainType eq 1}">checked="checked"</c:if>/>
                    <input type="radio" name="mainType" lay-filter="mainType" lay-verify="required" value="2" title="<fmt:message key='gth'/>" <c:if test="${supplier.mainType eq 2}">checked="checked"</c:if>/>
                    <input type="radio" name="mainType" lay-filter="mainType" lay-verify="required" value="3" title="<fmt:message key='gr'/>" <c:if test="${supplier.mainType eq 3}">checked="checked"</c:if>/>
                </div>
            </div>

            <div id="merchantEnterpriseInfo" style="display:none;">


                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                    <legend><fmt:message key='qyxx'/></legend>
                </fieldset>
                <form:hidden path="merchantEnterpriseInfo.id" class="layui-input"/>

                <div class="layui-row layui-col-space30">
                    <div class="layui-col-md6">


                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='gsmc'/></label>
                            <div class="layui-input-inline">
                                <form:input path="merchantEnterpriseInfo.company" class="layui-input"/>
                            </div>
                        </div>


                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='frxm'/></label>
                            <div class="layui-input-inline">
                                <form:input path="merchantEnterpriseInfo.legalPersonRealname" class="layui-input"/>
                            </div>
                        </div>


                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='qy2'/></label>
                            <div class="layui-input-inline" style="width: 100px;">
                                <select id="merchantEnterpriseInfo-province" name="merchantEnterpriseInfo.province" lay-filter="merchantEnterpriseInfo-province">
                                    <option value="" data_id=""><fmt:message key='qxzs'/></option>
                                </select>

                            </div>

                            <div class="layui-input-inline" style="width: 100px;">
                                <select id="merchantEnterpriseInfo-city" name="merchantEnterpriseInfo.city" lay-filter="merchantEnterpriseInfo-city">
                                    <option value="" data_id=""><fmt:message key='qxzs1'/></option>
                                </select>

                            </div>

                            <div class="layui-input-inline" style="width: 100px;">
                                <select id="merchantEnterpriseInfo-area" name="merchantEnterpriseInfo.area">
                                    <option value="" data_id=""><fmt:message key='qxzx/q'/></option>
                                </select>

                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='frsfzzm'/></label>
                            <div class="layui-input-block">
                                <form:hidden path="merchantEnterpriseInfo.legalPersonIdCardPhoto" id="merchantEnterpriseInfo-legalPersonIdCardPhoto" class="layui-input"/>
                                <a type="button" id="choose-merchantEnterpriseInfo-legalPersonIdCardPhoto" value="<fmt:message key='sc'/>" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sczp'/></a>
                                <div id="feijinImage-merchantEnterpriseInfo-legalPersonIdCardPhoto">
                                    <c:if test="${not empty supplier.merchantEnterpriseInfo.legalPersonIdCardPhoto}">
                                        <img src="${store_domain}/uploads/${supplier.merchantEnterpriseInfo.legalPersonIdCardPhoto}" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty supplier.merchantEnterpriseInfo.legalPersonIdCardPhoto}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='gsyyzz'/></label>
                            <div class="layui-input-block">
                                <form:hidden path="merchantEnterpriseInfo.businessLicensePhoto" id="merchantEnterpriseInfo-businessLicensePhoto" class="layui-input"/>
                                <a type="button" id="choose-merchantEnterpriseInfo-businessLicensePhoto" value="<fmt:message key='sc'/>" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp'/></a>
                                <div id="feijinImage-merchantEnterpriseInfo-businessLicensePhoto">
                                    <c:if test="${not empty supplier.merchantEnterpriseInfo.businessLicensePhoto}">
                                        <img src="${store_domain}/uploads/${supplier.merchantEnterpriseInfo.businessLicensePhoto}" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty supplier.merchantEnterpriseInfo.businessLicensePhoto}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="layui-col-md6">

                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='yyzzhm'/></label>
                            <div class="layui-input-inline">
                                <form:input path="merchantEnterpriseInfo.businessLicenseNo" class="layui-input"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='frsfz'/></label>
                            <div class="layui-input-inline">
                                <form:input path="merchantEnterpriseInfo.legalPersonIdCardNo" class="layui-input"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='dz'/></label>
                            <div class="layui-input-inline">
                                <form:input path="merchantEnterpriseInfo.address" class="layui-input"/>
                            </div>
                        </div>


                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='frsfzfm'/></label>
                            <div class="layui-input-block">
                                <form:hidden path="merchantEnterpriseInfo.legalPersonIdCardPhotoBack" id="merchantEnterpriseInfo-legalPersonIdCardPhotoBack" class="layui-input"/>
                                <a type="button" id="choose-merchantEnterpriseInfo-legalPersonIdCardPhotoBack" value="<fmt:message key='sc'/>" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp'/></a>
                                <div id="feijinImage-merchantEnterpriseInfo-legalPersonIdCardPhotoBack">
                                    <c:if test="${not empty supplier.merchantEnterpriseInfo.legalPersonIdCardPhotoBack}">
                                        <img src="${store_domain}/uploads/${supplier.merchantEnterpriseInfo.legalPersonIdCardPhotoBack}" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty supplier.merchantEnterpriseInfo.legalPersonIdCardPhotoBack}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>

            <div id="merchantIndividualInfo" style="display:none;">

                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                    <legend><fmt:message key='gthxx'/></legend>
                </fieldset>

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='xm'/></label>
                    <div class="layui-input-inline">
                        <form:input path="merchantIndividualInfo.legalPersonRealname" class="layui-input"/>
                    </div>
                </div>

                <form:hidden path="merchantIndividualInfo.id" class="layui-input"/>

                <div class="layui-row layui-col-space30">
                    <div class="layui-col-md6">

                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='ssdq'/></label>
                            <div class="layui-input-inline" style="width: 100px;">
                                <select id="merchantIndividualInfo-province" name="merchantIndividualInfo.province" lay-filter="merchantIndividualInfo-province">
                                    <option value="" data_id=""><fmt:message key='qxzs'/></option>
                                </select>

                            </div>

                            <div class="layui-input-inline" style="width: 100px;">
                                <select id="merchantIndividualInfo-city" name="merchantIndividualInfo.city" lay-filter="merchantIndividualInfo-city">
                                    <option value="" data_id=""><fmt:message key='qxzs1'/></option>
                                </select>

                            </div>

                            <div class="layui-input-inline" style="width: 100px;">
                                <select id="merchantIndividualInfo-area" name="merchantIndividualInfo.area">
                                    <option value="" data_id=""><fmt:message key='qxzx/q'/></option>
                                </select>

                            </div>
                        </div>


                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='yyzzhm'/></label>
                            <div class="layui-input-inline">
                                <form:input path="merchantIndividualInfo.businessLicenseNo" class="layui-input"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sfzzm'/></label>
                            <div class="layui-input-block">
                                <form:hidden path="merchantIndividualInfo.idCardPhoto" id="merchantIndividualInfo-idCardPhoto" class="layui-input"/>
                                <a type="button" id="choose-merchantIndividualInfo-idCardPhoto" value="<fmt:message key='sc'/>" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp'/></a>
                                <div id="feijinImage-merchantIndividualInfo-idCardPhoto">
                                    <c:if test="${not empty supplier.merchantIndividualInfo.idCardPhoto}">
                                        <img src="${store_domain}/uploads/${supplier.merchantIndividualInfo.idCardPhoto}" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty supplier.merchantIndividualInfo.idCardPhoto}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>
                        </div>


                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='yyzz'/></label>
                            <div class="layui-input-block">
                                <form:hidden path="merchantIndividualInfo.businessLicensePhoto" id="merchantIndividualInfo-businessLicensePhoto" class="layui-input"/>
                                <a type="button" id="choose-merchantIndividualInfo-businessLicensePhoto" value="<fmt:message key='sc'/>" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp'/></a>
                                <div id="feijinImage-merchantIndividualInfo-businessLicensePhoto">
                                    <c:if test="${not empty supplier.merchantIndividualInfo.businessLicensePhoto}">
                                        <img src="${store_domain}/uploads/${supplier.merchantIndividualInfo.businessLicensePhoto}" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty supplier.merchantIndividualInfo.businessLicensePhoto}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="layui-col-md6">

                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sfz'/></label>
                            <div class="layui-input-inline">
                                <form:input path="merchantIndividualInfo.idCardNo" class="layui-input"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='dz'/></label>
                            <div class="layui-input-inline">
                                <form:input path="merchantIndividualInfo.address" class="layui-input"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sfzfm'/></label>
                            <div class="layui-input-block">
                                <form:hidden path="merchantIndividualInfo.idCardPhotoBack" id="merchantIndividualInfo-idCardPhotoBack" class="layui-input"/>
                                <a type="button" id="choose-merchantIndividualInfo-idCardPhotoBack" value="<fmt:message key='sc'/>" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp'/></a>
                                <div id="feijinImage-merchantIndividualInfo-idCardPhotoBack">
                                    <c:if test="${not empty supplier.merchantIndividualInfo.idCardPhotoBack}">
                                        <img src="${store_domain}/uploads/${supplier.merchantIndividualInfo.idCardPhotoBack}" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty supplier.merchantIndividualInfo.idCardPhotoBack}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>

            <div id="merchantPersonalInfo" style="display:none;">


                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                    <legend><fmt:message key='grxx'/></legend>
                </fieldset>

                <form:hidden path="merchantPersonalInfo.id" class="layui-input"/>

                <div class="layui-row layui-col-space30">
                    <div class="layui-col-md6">


                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='xm'/></label>
                            <div class="layui-input-inline">
                                <form:input path="merchantPersonalInfo.legalPersonRealname" class="layui-input"/>
                            </div>
                        </div>


                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='ssdq'/></label>
                            <div class="layui-input-inline" style="width: 100px;">
                                <select id="merchantPersonalInfo-province" name="merchantPersonalInfo.province" lay-filter="merchantPersonalInfo-province">
                                    <option value="" data_id=""><fmt:message key='qxzs'/></option>
                                </select>

                            </div>

                            <div class="layui-input-inline" style="width: 100px;">
                                <select id="merchantPersonalInfo-city" name="merchantPersonalInfo.city" lay-filter="merchantPersonalInfo-city">
                                    <option value="" data_id=""><fmt:message key='qxzs1'/></option>
                                </select>

                            </div>

                            <div class="layui-input-inline" style="width: 100px;">
                                <select id="merchantPersonalInfo-area" name="merchantPersonalInfo.area">
                                    <option value="" data_id=""><fmt:message key='qxzx/q'/></option>
                                </select>

                            </div>
                        </div>


                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sfzzm'/></label>
                            <div class="layui-input-block">
                                <form:hidden path="merchantPersonalInfo.legalPersonIdCardPhoto" id="merchantPersonalInfo-legalPersonIdCardPhoto" class="layui-input"/>
                                <a type="button" id="choose-merchantPersonalInfo-legalPersonIdCardPhoto" value="<fmt:message key='sc'/>" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp'/></a>
                                <div id="feijinImage-merchantPersonalInfo-legalPersonIdCardPhoto">
                                    <c:if test="${not empty supplier.merchantPersonalInfo.legalPersonIdCardPhoto}">
                                        <img src="${store_domain}/uploads/${supplier.merchantPersonalInfo.legalPersonIdCardPhoto}" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty supplier.merchantPersonalInfo.legalPersonIdCardPhoto}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="layui-col-md6">

                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sfzhm'/></label>
                            <div class="layui-input-inline">
                                <form:input path="merchantPersonalInfo.idCardNo" class="layui-input"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><fmt:message key='dz'/></label>
                            <div class="layui-input-inline">
                                <form:input path="merchantPersonalInfo.address" class="layui-input"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sfzfm'/></label>
                            <div class="layui-input-block">
                                <form:hidden path="merchantPersonalInfo.legalPersonIdCardPhotoBack" id="merchantPersonalInfo-legalPersonIdCardPhotoBack" class="layui-input"/>
                                <a type="button" id="choose-merchantPersonalInfo-legalPersonIdCardPhotoBack" value="<fmt:message key='sc'/>" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp'/></a>
                                <div id="feijinImage-merchantPersonalInfo-legalPersonIdCardPhotoBack">
                                    <c:if test="${not empty supplier.merchantPersonalInfo.legalPersonIdCardPhotoBack}">
                                        <img src="${store_domain}/uploads/${supplier.merchantPersonalInfo.legalPersonIdCardPhotoBack}" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty supplier.merchantPersonalInfo.legalPersonIdCardPhotoBack}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>
                        </div>


                    </div>
                </div>
            </div>

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='kpxx'/></legend>
            </fieldset>

            <div class="layui-form-item">
                <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='fplx'/></label>
                <div class="layui-input-inline" style="width:70%;">
                    <input type="radio" name="merchantInvoiceTitleType" lay-filter="merchantInvoiceTitleType" lay-verify="required" value="1" title="<fmt:message key='qy1'/>" <c:if test="${supplier.merchantInvoiceTitleType eq 1}">checked="checked"</c:if>/>
                    <input type="radio" name="merchantInvoiceTitleType" lay-filter="merchantInvoiceTitleType" lay-verify="required" value="2" title="<fmt:message key='gr'/>" <c:if test="${supplier.merchantInvoiceTitleType eq 2}">checked="checked"</c:if>/>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='tt'/></label>
                <div class="layui-input-inline">
                    <form:input path="merchantInvoiceTitle" lay-verify="required" class="layui-input"/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"> <fmt:message key='sh'/></label>
                <div class="layui-input-inline">
                    <form:input path="merchantInvoiceTFN" class="layui-input"/>
                </div>
            </div>



            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='yhkxx'/></legend>
            </fieldset>

            <div class="layui-row layui-col-space30">

                <div class="layui-col-md6">

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='khr'/></label>
                        <div class="layui-input-inline">
                            <form:input path="bankAccountHolder" lay-verify="required" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='yhkh'/></label>
                        <div class="layui-input-inline">
                            <form:input path="bankCardNo" lay-verify="required|bankcard" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='khh'/></label>
                        <div class="layui-input-inline">
                            <form:input path="bankName" lay-verify="required" class="layui-input"/>
                        </div>
                    </div>


                </div>

                <div class="layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='ylsjh'/></label>
                        <div class="layui-input-inline">
                            <form:input path="bankMobile" lay-verify="required|number" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='ssss'/></label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <select id="bankProvince" name="bankProvince" lay-filter="bankProvince">
                                <option value="" data_id=""><fmt:message key='qxzs'/></option>
                            </select>
                        </div>
                        <div class="layui-input-inline" style="width: 100px;">
                            <select id="bankCity" name="bankCity" lay-filter="bankCity">
                                <option value="" data_id=""><fmt:message key='qxzs1'/></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='khzh'/></label>
                        <div class="layui-input-inline">
                            <form:input path="bankSubBranchName" lay-verify="required" class="layui-input"/>
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-input-block">
                <div style="display: none"><input type="button" value="<fmt:message key='bc'/>" class="layui-btn" id="submit" lay-filter="submit" lay-submit></div>
            </div>

        </form:form>
    </div>
</div>

<div style="display:none;">

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantEnterpriseInfo-legalPersonIdCardPhoto" enctype="multipart/form-data">
        <input id="merchantEnterpriseInfo-legalPersonIdCardPhoto-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantEnterpriseInfo-businessLicensePhoto" enctype="multipart/form-data">
        <input id="merchantEnterpriseInfo-businessLicensePhoto-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantEnterpriseInfo-legalPersonIdCardPhotoBack" enctype="multipart/form-data">
        <input id="merchantEnterpriseInfo-legalPersonIdCardPhotoBack-file" name="file" type="file"/>
    </form>


    <form action="${web_domain}/upload/image" method="post" id="upload-merchantIndividualInfo-idCardPhoto" enctype="multipart/form-data">
        <input id="merchantIndividualInfo-idCardPhoto-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantIndividualInfo-businessLicensePhoto" enctype="multipart/form-data">
        <input id="merchantIndividualInfo-businessLicensePhoto-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantIndividualInfo-idCardPhotoBack" enctype="multipart/form-data">
        <input id="merchantIndividualInfo-idCardPhotoBack-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantPersonalInfo-legalPersonIdCardPhoto" enctype="multipart/form-data">
        <input id="merchantPersonalInfo-legalPersonIdCardPhoto-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantPersonalInfo-legalPersonIdCardPhotoBack" enctype="multipart/form-data">
        <input id="merchantPersonalInfo-legalPersonIdCardPhotoBack-file" name="file" type="file"/>
    </form>

</div>

<script type="text/javascript" src="${web_domain}/resources/plugins/region2.0.js"></script>
<script>
    $(function () {

        //切换主体类型
        var id = $("input[name='mainType']:checked").val();
        if (id == 1) {
            $("#merchantEnterpriseInfo").show();
            $("#merchantIndividualInfo").hide();
            $("#merchantPersonalInfo").hide();
        }

        if (id == 2) {
            $("#merchantEnterpriseInfo").hide();
            $("#merchantIndividualInfo").show();
            $("#merchantPersonalInfo").hide();
        }

        if (id == 3) {
            $("#merchantEnterpriseInfo").hide();
            $("#merchantIndividualInfo").hide();
            $("#merchantPersonalInfo").show();
        }

        //企业主体信息的省市区级联选择下拉框
        var merchantEnterpriseInfonames = ["merchantEnterpriseInfo-province", "merchantEnterpriseInfo-city", "merchantEnterpriseInfo-area"];
        var merchantEnterpriseInfovalues = ["${supplier.merchantEnterpriseInfo.province}", "${supplier.merchantEnterpriseInfo.city}", "${supplier.merchantEnterpriseInfo.area}"];
        region($, merchantEnterpriseInfonames, merchantEnterpriseInfovalues);

        //个体户主体信息的省市区级联选择下拉框
        var merchantIndividualInfonames = ["merchantIndividualInfo-province", "merchantIndividualInfo-city", "merchantIndividualInfo-area"];
        var merchantIndividualInfovalues = ["${supplier.merchantIndividualInfo.province}", "${supplier.merchantIndividualInfo.city}", "${supplier.merchantIndividualInfo.area}"];
        region($, merchantIndividualInfonames, merchantIndividualInfovalues);

        //个人主体信息的省市区级联选择下拉框
        var merchantPersonalInfonames = ["merchantPersonalInfo-province", "merchantPersonalInfo-city", "merchantPersonalInfo-area"];
        var merchantPersonalInfovalues = ["${supplier.merchantPersonalInfo.province}", "${supplier.merchantPersonalInfo.city}", "${supplier.merchantPersonalInfo.area}"];
        region($, merchantPersonalInfonames, merchantPersonalInfovalues);

        //银行开户所属省市
        var merchantBanknames = ["bankProvince", "bankCity"];
        var merchantBankvalues = ["${supplier.bankProvince}", "${supplier.bankCity}"];
        region($, merchantBanknames, merchantBankvalues);


        //企业法人身份证上传
        $("#choose-merchantEnterpriseInfo-legalPersonIdCardPhoto").click(function () {
            $("#merchantEnterpriseInfo-legalPersonIdCardPhoto-file").click();
        });
        $("#merchantEnterpriseInfo-legalPersonIdCardPhoto-file").change(function () {
            $("#upload-merchantEnterpriseInfo-legalPersonIdCardPhoto").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantEnterpriseInfo-legalPersonIdCardPhoto").attr("value", result.path);
                        $("#feijinImage-merchantEnterpriseInfo-legalPersonIdCardPhoto").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //企业营业执照上传
        $("#choose-merchantEnterpriseInfo-businessLicensePhoto").click(function () {
            $("#merchantEnterpriseInfo-businessLicensePhoto-file").click();
        });
        $("#merchantEnterpriseInfo-businessLicensePhoto-file").change(function () {
            $("#upload-merchantEnterpriseInfo-businessLicensePhoto").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantEnterpriseInfo-businessLicensePhoto").attr("value", result.path);
                        $("#feijinImage-merchantEnterpriseInfo-businessLicensePhoto").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //企业法人身份证反面上传
        $("#choose-merchantEnterpriseInfo-legalPersonIdCardPhotoBack").click(function () {
            $("#merchantEnterpriseInfo-legalPersonIdCardPhotoBack-file").click();
        });
        $("#merchantEnterpriseInfo-legalPersonIdCardPhotoBack-file").change(function () {
            $("#upload-merchantEnterpriseInfo-legalPersonIdCardPhotoBack").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantEnterpriseInfo-legalPersonIdCardPhotoBack").attr("value", result.path);
                        $("#feijinImage-merchantEnterpriseInfo-legalPersonIdCardPhotoBack").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //个体户身份证正面上传
        $("#choose-merchantIndividualInfo-idCardPhoto").click(function () {
            $("#merchantIndividualInfo-idCardPhoto-file").click();
        });
        $("#merchantIndividualInfo-idCardPhoto-file").change(function () {
            $("#upload-merchantIndividualInfo-idCardPhoto").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantIndividualInfo-idCardPhoto").attr("value", result.path);
                        $("#feijinImage-merchantIndividualInfo-idCardPhoto").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //个体户营业执照上传
        $("#choose-merchantIndividualInfo-businessLicensePhoto").click(function () {
            $("#merchantIndividualInfo-businessLicensePhoto-file").click();
        });
        $("#merchantIndividualInfo-businessLicensePhoto-file").change(function () {
            $("#upload-merchantIndividualInfo-businessLicensePhoto").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantIndividualInfo-businessLicensePhoto").attr("value", result.path);
                        $("#feijinImage-merchantIndividualInfo-businessLicensePhoto").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //个体户身份证反面上传
        $("#choose-merchantIndividualInfo-idCardPhotoBack").click(function () {
            $("#merchantIndividualInfo-idCardPhotoBack-file").click();
        });
        $("#merchantIndividualInfo-idCardPhotoBack-file").change(function () {
            $("#upload-merchantIndividualInfo-idCardPhotoBack").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantIndividualInfo-idCardPhotoBack").attr("value", result.path);
                        $("#feijinImage-merchantIndividualInfo-idCardPhotoBack").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });


        //个人身份证上传
        $("#choose-merchantPersonalInfo-legalPersonIdCardPhoto").click(function () {
            $("#merchantPersonalInfo-legalPersonIdCardPhoto-file").click();
        });
        $("#merchantPersonalInfo-legalPersonIdCardPhoto-file").change(function () {
            $("#upload-merchantPersonalInfo-legalPersonIdCardPhoto").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantPersonalInfo-legalPersonIdCardPhoto").attr("value", result.path);
                        $("#feijinImage-merchantPersonalInfo-legalPersonIdCardPhoto").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //个人身份证反面上传
        $("#choose-merchantPersonalInfo-legalPersonIdCardPhotoBack").click(function () {
            $("#merchantPersonalInfo-legalPersonIdCardPhotoBack-file").click();
        });
        $("#merchantPersonalInfo-legalPersonIdCardPhotoBack-file").change(function () {
            $("#upload-merchantPersonalInfo-legalPersonIdCardPhotoBack").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantPersonalInfo-legalPersonIdCardPhotoBack").attr("value", result.path);
                        $("#feijinImage-merchantPersonalInfo-legalPersonIdCardPhotoBack").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });


        //选择主体类型（企业、个体户、个人）
        layui.use(['form', 'laydate'], function () {

            var form = layui.form;
            var laydate = layui.laydate;

            form.on('radio(mainType)', function (data) {
                var id = data.value;

                if (id == 1) {
                    $("#merchantEnterpriseInfo").show();
                    $("#merchantIndividualInfo").hide();
                    $("#merchantPersonalInfo").hide();
                }

                if (id == 2) {
                    $("#merchantEnterpriseInfo").hide();
                    $("#merchantIndividualInfo").show();
                    $("#merchantPersonalInfo").hide();
                }

                if (id == 3) {
                    $("#merchantEnterpriseInfo").hide();
                    $("#merchantIndividualInfo").hide();
                    $("#merchantPersonalInfo").show();
                }
            });

            form.verify({
                bankcard: [/^\d*$/, '<fmt:message key='yhkznbhsz'/>']
            });

            form.on('submit(submit)', function (data) {

                var mainType = $(":radio[name='mainType']:checked").val();

                if (!mainType) {
                    layui.use('layer', function () {
                        layer.msg("<fmt:message key='qxzgysztlx'/>");
                    });

                    return false;
                }

                var goodsChannels = [];
                $("input[name='channels']:checked").each(function (index, item) {
                    goodsChannels.push($(item).val());
                });

                if (goodsChannels.length == 0) {
                    layui.use('layer', function () {
                        layer.msg("<fmt:message key='qxzjylm'/>");
                    });

                    return false;
                }

                $("#merchantGoodsChannelsData").attr("value", goodsChannels.join("-"));

                $("#serviceForm").ajaxSubmit({
                    success: function (result) {
                        if (result.status) {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                            parent.$("#search").click();
                        } else {
                            layer.msg(result.message);
                        }
                    }
                });
            });


        });

    });
</script>
</body>
</fmt:bundle>
</html>